<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>伸缩盒</title>
  <style>
    body {
      margin: 0;
    }

    .article {
      /* 设置伸缩盒容器 */
      display: flex;
      /* 设置主轴方向为y轴 */
      /* flex-direction: column; */
      width: 100%;
      height: 400px;
      background-color: darkorange;
    }

    .article div:nth-child(1) {
      flex: 1;
      background-color: darkorchid;
    }

    .article div:nth-child(2) {
      flex: 1;
      height: 200px;
      background-color: darksalmon;
    }

    .article div:nth-child(3) {
      flex: 2;
      background-color: darkslateblue;
    }
  </style>
</head>

<body>
  <div class="article">
    <div></div>
    <div></div>
    <div></div>
  </div>
</body>

</html>